package com.yu.jay.mapper;


import com.yu.jay.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    //增
    @Insert("INSERT INTO `user` (id, name, gender, phoneNum, password)" +
            "values(#{id}, #{name}, #{gender}, #{phoneNum}, #{password})")
    Boolean addUser(User user);

    //删
    @Delete("DELETE FROM `user` WHERE id = #{id}")
    Boolean delUser(User user);

    //改
    @Update("update `user` set name=#{name}, gender=#{gender}, phoneNum=#{phoneNum}, password=#{password} where id=#{id}")
    Boolean updateUser(User user);

    //查
    @Select("select * from `user`")
    List<User> getUsers();
}
